home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_06_05
/
v6n5039a.txt
< prev
next >
Wrap
Text File
|
1989-09-26
|
2KB
|
27 lines
╔═════════════════════════════════════════════════════════════════════════════╗
║ ║
║ Fig. 2 LALR Error Recovery on a POPL program ║
║ ║
║ Parsing ... ║
║ 1 INT avg(INT a[10], INT count) ║
║ 2 { ║
║ 3 INT indx, sum; #local variables# ║
║ 4 ║
║ 5 indx = 0; ║
║ ----------------^ replacing with := ║
║ 6 sum := 0; ║
║ 7 WHILE indx < count DO { ║
║ 8 sum := sum + a[indx]; ║
║ 9 indx := indx + 1; ║
║ 10 } ║
║ 11 sum := sum ) / count; ║
║ -----------------------^ ignoring ) ║
║ 12 RETURN sum; ║
║ 13 ║
║ 14 ║
║ --------^ inserting } ║
║ 3 warnings, 14 lines, 0.11 sec. ║
║ ║
╚═════════════════════════════════════════════════════════════════════════════╝